home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 June: Reference Library / Dev.CD Jun 99 RL Disk 1.toast / What's New / Development Kits / ColorSync 2.6 Mac SDK / Interfaces / CMICCProfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-12  |  31.3 KB  |  962 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    ICC Profile Format Definitions
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    ColorSync 2.6 SDK for use with Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1994-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __CMICCPROFILE__
  18. #define __CMICCPROFILE__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23.  
  24.  
  25.  
  26. #if PRAGMA_ONCE
  27. #pragma once
  28. #endif
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34. #if PRAGMA_IMPORT
  35. #pragma import on
  36. #endif
  37.  
  38. #if PRAGMA_STRUCT_ALIGN
  39.     #pragma options align=mac68k
  40. #elif PRAGMA_STRUCT_PACKPUSH
  41.     #pragma pack(push, 2)
  42. #elif PRAGMA_STRUCT_PACK
  43.     #pragma pack(2)
  44. #endif
  45.  
  46. /* ICC Profile version constants  */
  47.  
  48. enum {
  49.     cmICCProfileVersion2        = 0x02000000,
  50.     cmICCProfileVersion21        = 0x02100000,
  51.     cmCS2ProfileVersion            = cmICCProfileVersion2,
  52.     cmCS1ProfileVersion            = 0x00000100                    /* ColorSync 1.0 profile version */
  53. };
  54.  
  55. /* Current Major version number */
  56.  
  57. enum {
  58.     cmProfileMajorVersionMask    = (long)0xFF000000,
  59.     cmCurrentProfileMajorVersion = 0x02000000
  60. };
  61.  
  62. /* magic cookie number for anonymous file ID */
  63.  
  64. enum {
  65.     cmMagicNumber                = FOUR_CHAR_CODE('acsp')
  66. };
  67.  
  68.  
  69. /************************************************************************/
  70. /*************** ColorSync 2.0 profile specification ********************/
  71. /************************************************************************/
  72. /**** flags field  ****/
  73.  
  74. enum {
  75.     cmICCReservedFlagsMask        = 0x0000FFFF,                    /* these bits of the flags field are defined and reserved by ICC */
  76.     cmEmbeddedMask                = 0x00000001,                    /* if bit 0 is 0 then not embedded profile, if 1 then embedded profile */
  77.     cmEmbeddedUseMask            = 0x00000002,                    /* if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only */
  78.     cmCMSReservedFlagsMask        = (long)0xFFFF0000,                /* these bits of the flags field are defined and reserved by CMS vendor */
  79.     cmQualityMask                = 0x00030000,                    /* if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best */
  80.     cmInterpolationMask            = 0x00040000,                    /* if bit 18 is 0 then interpolation, if 1 then lookup only */
  81.     cmGamutCheckingMask            = 0x00080000                    /* if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info */
  82. };
  83.  
  84. /* copyright-protection flag options */
  85.  
  86. enum {
  87.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  88.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  89. };
  90.  
  91. /* speed and quality flag options */
  92.  
  93. enum {
  94.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  95.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  96.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  97. };
  98.  
  99.  
  100. /**** deviceAttributes fields ****/
  101. /* deviceAttributes[0] is defined by and reserved for device vendors */
  102. /* deviceAttributes[1] is defined by and reserved for ICC */
  103. /* The following bits of deviceAttributes[1] are currently defined */
  104.  
  105. enum {
  106.     cmReflectiveTransparentMask    = 0x00000001,                    /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  107.     cmGlossyMatteMask            = 0x00000002                    /* if bit 1 is 0 then glossy, if 1 then matte */
  108. };
  109.  
  110. /* device/media attributes element values  */
  111.  
  112. enum {
  113.     cmReflective                = 0,                            /* if bit 0 is 0 then reflective media, if 1 then transparency media */
  114.     cmGlossy                    = 1                                /* if bit 1 is 0 then glossy, if 1 then matte */
  115. };
  116.  
  117.  
  118. /**** renderingIntent field ****/
  119.  
  120. enum {
  121.     cmPerceptual                = 0,                            /* Photographic images */
  122.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  123.     cmSaturation                = 2,                            /* Business graphics */
  124.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  125. };
  126.  
  127.  
  128.  
  129. /* data type element values */
  130.  
  131. enum {
  132.     cmAsciiData                    = 0,
  133.     cmBinaryData                = 1
  134. };
  135.  
  136. /* screen encodings  */
  137.  
  138. enum {
  139.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  140.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  141. };
  142.  
  143. /* 2.0 tag type information */
  144.  
  145. enum {
  146.     cmNumHeaderElements            = 10
  147. };
  148.  
  149. /* public tags */
  150.  
  151. enum {
  152.     cmAToB0Tag                    = FOUR_CHAR_CODE('A2B0'),
  153.     cmAToB1Tag                    = FOUR_CHAR_CODE('A2B1'),
  154.     cmAToB2Tag                    = FOUR_CHAR_CODE('A2B2'),
  155.     cmBlueColorantTag            = FOUR_CHAR_CODE('bXYZ'),
  156.     cmBlueTRCTag                = FOUR_CHAR_CODE('bTRC'),
  157.     cmBToA0Tag                    = FOUR_CHAR_CODE('B2A0'),
  158.     cmBToA1Tag                    = FOUR_CHAR_CODE('B2A1'),
  159.     cmBToA2Tag                    = FOUR_CHAR_CODE('B2A2'),
  160.     cmCalibrationDateTimeTag    = FOUR_CHAR_CODE('calt'),
  161.     cmCharTargetTag                = FOUR_CHAR_CODE('targ'),
  162.     cmCopyrightTag                = FOUR_CHAR_CODE('cprt'),
  163.     cmDeviceMfgDescTag            = FOUR_CHAR_CODE('dmnd'),
  164.     cmDeviceModelDescTag        = FOUR_CHAR_CODE('dmdd'),
  165.     cmGamutTag                    = FOUR_CHAR_CODE('gamt'),
  166.     cmGrayTRCTag                = FOUR_CHAR_CODE('kTRC'),
  167.     cmGreenColorantTag            = FOUR_CHAR_CODE('gXYZ'),
  168.     cmGreenTRCTag                = FOUR_CHAR_CODE('gTRC'),
  169.     cmLuminanceTag                = FOUR_CHAR_CODE('lumi'),
  170.     cmMeasurementTag            = FOUR_CHAR_CODE('meas'),
  171.     cmMediaBlackPointTag        = FOUR_CHAR_CODE('bkpt'),
  172.     cmMediaWhitePointTag        = FOUR_CHAR_CODE('wtpt'),
  173.     cmNamedColorTag                = FOUR_CHAR_CODE('ncol'),
  174.     cmNamedColor2Tag            = FOUR_CHAR_CODE('ncl2'),
  175.     cmPreview0Tag                = FOUR_CHAR_CODE('pre0'),
  176.     cmPreview1Tag                = FOUR_CHAR_CODE('pre1'),
  177.     cmPreview2Tag                = FOUR_CHAR_CODE('pre2'),
  178.     cmProfileDescriptionTag        = FOUR_CHAR_CODE('desc'),
  179.     cmProfileSequenceDescTag    = FOUR_CHAR_CODE('pseq'),
  180.     cmPS2CRD0Tag                = FOUR_CHAR_CODE('psd0'),
  181.     cmPS2CRD1Tag                = FOUR_CHAR_CODE('psd1'),
  182.     cmPS2CRD2Tag                = FOUR_CHAR_CODE('psd2'),
  183.     cmPS2CRD3Tag                = FOUR_CHAR_CODE('psd3'),
  184.     cmPS2CSATag                    = FOUR_CHAR_CODE('ps2s'),
  185.     cmPS2RenderingIntentTag        = FOUR_CHAR_CODE('ps2i'),
  186.     cmRedColorantTag            = FOUR_CHAR_CODE('rXYZ'),
  187.     cmRedTRCTag                    = FOUR_CHAR_CODE('rTRC'),
  188.     cmScreeningDescTag            = FOUR_CHAR_CODE('scrd'),
  189.     cmScreeningTag                = FOUR_CHAR_CODE('scrn'),
  190.     cmTechnologyTag                = FOUR_CHAR_CODE('tech'),
  191.     cmUcrBgTag                    = FOUR_CHAR_CODE('bfd '),
  192.     cmViewingConditionsDescTag    = FOUR_CHAR_CODE('vued'),
  193.     cmViewingConditionsTag        = FOUR_CHAR_CODE('view')
  194. };
  195.  
  196. /* custom tags */
  197.  
  198. enum {
  199.     cmPS2CRDVMSizeTag            = FOUR_CHAR_CODE('psvm'),
  200.     cmVideoCardGammaTag            = FOUR_CHAR_CODE('vcgt'),
  201.     cmMakeAndModelTag            = FOUR_CHAR_CODE('mmod')
  202. };
  203.  
  204. /* technology tag descriptions */
  205.  
  206. enum {
  207.     cmTechnologyFilmScanner        = FOUR_CHAR_CODE('fscn'),
  208.     cmTechnologyReflectiveScanner = FOUR_CHAR_CODE('rscn'),
  209.     cmTechnologyInkJetPrinter    = FOUR_CHAR_CODE('ijet'),
  210.     cmTechnologyThermalWaxPrinter = FOUR_CHAR_CODE('twax'),
  211.     cmTechnologyElectrophotographicPrinter = FOUR_CHAR_CODE('epho'),
  212.     cmTechnologyElectrostaticPrinter = FOUR_CHAR_CODE('esta'),
  213.     cmTechnologyDyeSublimationPrinter = FOUR_CHAR_CODE('dsub'),
  214.     cmTechnologyPhotographicPaperPrinter = FOUR_CHAR_CODE('rpho'),
  215.     cmTechnologyFilmWriter        = FOUR_CHAR_CODE('fprn'),
  216.     cmTechnologyVideoMonitor    = FOUR_CHAR_CODE('vidm'),
  217.     cmTechnologyVideoCamera        = FOUR_CHAR_CODE('vidc'),
  218.     cmTechnologyProjectionTelevision = FOUR_CHAR_CODE('pjtv'),
  219.     cmTechnologyCRTDisplay        = FOUR_CHAR_CODE('CRT '),
  220.     cmTechnologyPMDisplay        = FOUR_CHAR_CODE('PMD '),
  221.     cmTechnologyAMDisplay        = FOUR_CHAR_CODE('AMD '),
  222.     cmTechnologyPhotoCD            = FOUR_CHAR_CODE('KPCD'),
  223.     cmTechnologyPhotoImageSetter = FOUR_CHAR_CODE('imgs'),
  224.     cmTechnologyGravure            = FOUR_CHAR_CODE('grav'),
  225.     cmTechnologyOffsetLithography = FOUR_CHAR_CODE('offs'),
  226.     cmTechnologySilkscreen        = FOUR_CHAR_CODE('silk'),
  227.     cmTechnologyFlexography        = FOUR_CHAR_CODE('flex')
  228. };
  229.  
  230. /* public type signatures */
  231.  
  232. enum {
  233.     cmSigCurveType                = FOUR_CHAR_CODE('curv'),
  234.     cmSigDataType                = FOUR_CHAR_CODE('data'),
  235.     cmSigDateTimeType            = FOUR_CHAR_CODE('dtim'),
  236.     cmSigLut16Type                = FOUR_CHAR_CODE('mft2'),
  237.     cmSigLut8Type                = FOUR_CHAR_CODE('mft1'),
  238.     cmSigMeasurementType        = FOUR_CHAR_CODE('meas'),
  239.     cmSigNamedColorType            = FOUR_CHAR_CODE('ncol'),
  240.     cmSigNamedColor2Type        = FOUR_CHAR_CODE('ncl2'),
  241.     cmSigProfileDescriptionType    = FOUR_CHAR_CODE('desc'),
  242.     cmSigScreeningType            = FOUR_CHAR_CODE('scrn'),
  243.     cmSigS15Fixed16Type            = FOUR_CHAR_CODE('sf32'),
  244.     cmSigSignatureType            = FOUR_CHAR_CODE('sig '),
  245.     cmSigTextType                = FOUR_CHAR_CODE('text'),
  246.     cmSigU16Fixed16Type            = FOUR_CHAR_CODE('uf32'),
  247.     cmSigU1Fixed15Type            = FOUR_CHAR_CODE('uf16'),
  248.     cmSigUInt32Type                = FOUR_CHAR_CODE('ui32'),
  249.     cmSigUInt64Type                = FOUR_CHAR_CODE('ui64'),
  250.     cmSigUInt8Type                = FOUR_CHAR_CODE('ui08'),
  251.     cmSigViewingConditionsType    = FOUR_CHAR_CODE('view'),
  252.     cmSigXYZType                = FOUR_CHAR_CODE('XYZ ')
  253. };
  254.  
  255. /* custom type signatures */
  256.  
  257. enum {
  258.     cmSigVideoCardGammaType        = FOUR_CHAR_CODE('vcgt'),
  259.     cmSigMakeAndModelType        = FOUR_CHAR_CODE('mmod')
  260. };
  261.  
  262.  
  263. /* Measurement type encodings */
  264. /* Measurement Flare */
  265.  
  266. enum {
  267.     cmFlare0                    = 0x00000000,
  268.     cmFlare100                    = 0x00000001
  269. };
  270.  
  271. /* Measurement Geometry    */
  272.  
  273. enum {
  274.     cmGeometryUnknown            = 0x00000000,
  275.     cmGeometry045or450            = 0x00000001,
  276.     cmGeometry0dord0            = 0x00000002
  277. };
  278.  
  279. /* Standard Observer    */
  280.  
  281. enum {
  282.     cmStdobsUnknown                = 0x00000000,
  283.     cmStdobs1931TwoDegrees        = 0x00000001,
  284.     cmStdobs1964TenDegrees        = 0x00000002
  285. };
  286.  
  287. /* Standard Illuminant */
  288.  
  289. enum {
  290.     cmIlluminantUnknown            = 0x00000000,
  291.     cmIlluminantD50                = 0x00000001,
  292.     cmIlluminantD65                = 0x00000002,
  293.     cmIlluminantD93                = 0x00000003,
  294.     cmIlluminantF2                = 0x00000004,
  295.     cmIlluminantD55                = 0x00000005,
  296.     cmIlluminantA                = 0x00000006,
  297.     cmIlluminantEquiPower        = 0x00000007,
  298.     cmIlluminantF8                = 0x00000008
  299. };
  300.  
  301. /* Spot Function Value */
  302.  
  303. enum {
  304.     cmSpotFunctionUnknown        = 0,
  305.     cmSpotFunctionDefault        = 1,
  306.     cmSpotFunctionRound            = 2,
  307.     cmSpotFunctionDiamond        = 3,
  308.     cmSpotFunctionEllipse        = 4,
  309.     cmSpotFunctionLine            = 5,
  310.     cmSpotFunctionSquare        = 6,
  311.     cmSpotFunctionCross            = 7
  312. };
  313.  
  314. /* Color Space Signatures */
  315.  
  316. enum {
  317.     cmXYZData                    = FOUR_CHAR_CODE('XYZ '),
  318.     cmLabData                    = FOUR_CHAR_CODE('Lab '),
  319.     cmLuvData                    = FOUR_CHAR_CODE('Luv '),
  320.     cmYxyData                    = FOUR_CHAR_CODE('Yxy '),
  321.     cmRGBData                    = FOUR_CHAR_CODE('RGB '),
  322.     cmGrayData                    = FOUR_CHAR_CODE('GRAY'),
  323.     cmHSVData                    = FOUR_CHAR_CODE('HSV '),
  324.     cmHLSData                    = FOUR_CHAR_CODE('HLS '),
  325.     cmCMYKData                    = FOUR_CHAR_CODE('CMYK'),
  326.     cmCMYData                    = FOUR_CHAR_CODE('CMY '),
  327.     cmMCH5Data                    = FOUR_CHAR_CODE('MCH5'),
  328.     cmMCH6Data                    = FOUR_CHAR_CODE('MCH6'),
  329.     cmMCH7Data                    = FOUR_CHAR_CODE('MCH7'),
  330.     cmMCH8Data                    = FOUR_CHAR_CODE('MCH8'),
  331.     cm3CLRData                    = FOUR_CHAR_CODE('3CLR'),
  332.     cm4CLRData                    = FOUR_CHAR_CODE('4CLR'),
  333.     cm5CLRData                    = FOUR_CHAR_CODE('5CLR'),
  334.     cm6CLRData                    = FOUR_CHAR_CODE('6CLR'),
  335.     cm7CLRData                    = FOUR_CHAR_CODE('7CLR'),
  336.     cm8CLRData                    = FOUR_CHAR_CODE('8CLR'),
  337.     cmNamedData                    = FOUR_CHAR_CODE('NAME')
  338. };
  339.  
  340. /* profileClass enumerations */
  341.  
  342. enum {
  343.     cmInputClass                = FOUR_CHAR_CODE('scnr'),
  344.     cmDisplayClass                = FOUR_CHAR_CODE('mntr'),
  345.     cmOutputClass                = FOUR_CHAR_CODE('prtr'),
  346.     cmLinkClass                    = FOUR_CHAR_CODE('link'),
  347.     cmAbstractClass                = FOUR_CHAR_CODE('abst'),
  348.     cmColorSpaceClass            = FOUR_CHAR_CODE('spac'),
  349.     cmNamedColorClass            = FOUR_CHAR_CODE('nmcl')
  350. };
  351.  
  352. /* platform enumerations */
  353.  
  354. enum {
  355.     cmMacintosh                    = FOUR_CHAR_CODE('APPL'),
  356.     cmMicrosoft                    = FOUR_CHAR_CODE('MSFT'),
  357.     cmSolaris                    = FOUR_CHAR_CODE('SUNW'),
  358.     cmSiliconGraphics            = FOUR_CHAR_CODE('SGI '),
  359.     cmTaligent                    = FOUR_CHAR_CODE('TGNT')
  360. };
  361.  
  362. /* ColorSync 1.0 elements */
  363.  
  364. enum {
  365.     cmCS1ChromTag                = FOUR_CHAR_CODE('chrm'),
  366.     cmCS1TRCTag                    = FOUR_CHAR_CODE('trc '),
  367.     cmCS1NameTag                = FOUR_CHAR_CODE('name'),
  368.     cmCS1CustTag                = FOUR_CHAR_CODE('cust')
  369. };
  370.  
  371. /* General element data types */
  372.  
  373. struct CMDateTime {
  374.     unsigned short                     year;
  375.     unsigned short                     month;
  376.     unsigned short                     dayOfTheMonth;
  377.     unsigned short                     hours;
  378.     unsigned short                     minutes;
  379.     unsigned short                     seconds;
  380. };
  381. typedef struct CMDateTime                CMDateTime;
  382.  
  383. struct CMFixedXYZColor {
  384.     Fixed                             X;
  385.     Fixed                             Y;
  386.     Fixed                             Z;
  387. };
  388. typedef struct CMFixedXYZColor            CMFixedXYZColor;
  389.  
  390. typedef unsigned short                     CMXYZComponent;
  391.  
  392. struct CMXYZColor {
  393.     CMXYZComponent                     X;
  394.     CMXYZComponent                     Y;
  395.     CMXYZComponent                     Z;
  396. };
  397. typedef struct CMXYZColor                CMXYZColor;
  398.  
  399. struct CM2Header {
  400.     unsigned long                     size;                        /* This is the total size of the Profile */
  401.     OSType                             CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  402.     unsigned long                     profileVersion;                /* Version of CMProfile format */
  403.     OSType                             profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  404.     OSType                             dataColorSpace;                /* color space of data */
  405.     OSType                             profileConnectionSpace;        /* profile connection color space */
  406.     CMDateTime                         dateTime;                    /* date and time of profile creation */
  407.     OSType                             CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  408.     OSType                             platform;                    /* primary profile platform, Registered with CS2 consortium */
  409.     unsigned long                     flags;                        /* profile flags */
  410.     OSType                             deviceManufacturer;            /* Registered with ICC consortium */
  411.     unsigned long                     deviceModel;                /* Registered with ICC consortium */
  412.     unsigned long                     deviceAttributes[2];        /* Attributes[0] is for device vendors, [1] is for ICC */
  413.     unsigned long                     renderingIntent;            /* preferred rendering intent of tagged object */
  414.     CMFixedXYZColor                 white;                        /* profile illuminant */
  415.     OSType                             creator;                    /* profile creator */
  416.     char                             reserved[44];                /* reserved for future use */
  417. };
  418. typedef struct CM2Header                CM2Header;
  419.  
  420. struct CMTagRecord {
  421.     OSType                             tag;                        /* Registered with CS2 consortium */
  422.     unsigned long                     elementOffset;                /* Relative to start of CMProfile */
  423.     unsigned long                     elementSize;
  424. };
  425. typedef struct CMTagRecord                CMTagRecord;
  426.  
  427. struct CMTagElemTable {
  428.     unsigned long                     count;
  429.     CMTagRecord                     tagList[1];                    /* Variable size */
  430. };
  431. typedef struct CMTagElemTable            CMTagElemTable;
  432. /* External 0x02002001 CMProfile */
  433.  
  434. struct CM2Profile {
  435.     CM2Header                         header;
  436.     CMTagElemTable                     tagTable;
  437.     char                             elemData[1];                /* Tagged element storage. Variable size */
  438. };
  439. typedef struct CM2Profile                CM2Profile;
  440. typedef CM2Profile *                    CM2ProfilePtr;
  441. typedef CM2ProfilePtr *                    CM2ProfileHandle;
  442. /* Tag Type Definitions */
  443.  
  444. struct CMCurveType {
  445.     OSType                             typeDescriptor;                /* 'curv' */
  446.     unsigned long                     reserved;                    /* fill with 0x00 */
  447.     unsigned long                     countValue;                    /* number of entries in table that follows */
  448.     unsigned short                     data[1];                    /* Tagged element storage. Variable size */
  449. };
  450. typedef struct CMCurveType                CMCurveType;
  451.  
  452. struct CMDataType {
  453.     OSType                             typeDescriptor;                /* 'data' */
  454.     unsigned long                     reserved;                    /* fill with 0x00 */
  455.     unsigned long                     dataFlag;                    /* 0 = ASCII, 1 = binary */
  456.     char                             data[1];                    /* Tagged element storage. Variable size */
  457. };
  458. typedef struct CMDataType                CMDataType;
  459.  
  460. struct CMDateTimeType {
  461.     OSType                             typeDescriptor;                /* 'dtim' */
  462.     unsigned long                     reserved;
  463.     CMDateTime                         dateTime;
  464. };
  465. typedef struct CMDateTimeType            CMDateTimeType;
  466.  
  467. struct CMLut16Type {
  468.     OSType                             typeDescriptor;                /* 'mft2' */
  469.     unsigned long                     reserved;                    /* fill with 0x00 */
  470.     unsigned char                     inputChannels;                /* Number of input channels */
  471.     unsigned char                     outputChannels;                /* Number of output channels */
  472.     unsigned char                     gridPoints;                    /* Number of clutTable grid points */
  473.     unsigned char                     reserved2;                    /* fill with 0x00 */
  474.     Fixed                             matrix[3][3];                /* */
  475.     unsigned short                     inputTableEntries;            /* */
  476.     unsigned short                     outputTableEntries;            /* */
  477.     unsigned short                     inputTable[1];                /* Variable size */
  478.     unsigned short                     CLUT[1];                    /* Variable size */
  479.     unsigned short                     outputTable[1];                /* Variable size */
  480. };
  481. typedef struct CMLut16Type                CMLut16Type;
  482.  
  483. struct CMLut8Type {
  484.     OSType                             typeDescriptor;                /* 'mft1' */
  485.     unsigned long                     reserved;                    /* fill with 0x00 */
  486.     unsigned char                     inputChannels;                /* */
  487.     unsigned char                     outputChannels;                /* */
  488.     unsigned char                     gridPoints;                    /* */
  489.     unsigned char                     reserved2;                    /* fill with 0x00 */
  490.     Fixed                             matrix[3][3];                /* */
  491.     unsigned char                     inputTable[256];            /* fixed size of 256 */
  492.     unsigned char                     CLUT[2];                    /* Variable size */
  493.     unsigned char                     outputTable[256];            /* fixed size of 256 */
  494. };
  495. typedef struct CMLut8Type                CMLut8Type;
  496.  
  497. struct CMMeasurementType {
  498.     OSType                             typeDescriptor;                /* 'meas' */
  499.     unsigned long                     reserved;                    /* fill with 0x00 */
  500.     unsigned long                     standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  501.     CMFixedXYZColor                 backingXYZ;                    /* absolute XYZ values of backing */
  502.     unsigned long                     geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  503.     unsigned long                     flare;                        /* 0 : 0%, 1 : 100% flare */
  504.     unsigned long                     illuminant;                    /* standard illuminant */
  505. };
  506. typedef struct CMMeasurementType        CMMeasurementType;
  507.  
  508. struct CMNamedColorType {
  509.     OSType                             typeDescriptor;                /* 'ncol' */
  510.     unsigned long                     reserved;                    /* fill with 0x00 */
  511.     unsigned long                     vendorFlag;                    /* */
  512.     unsigned long                     count;                        /* count of named colors in array that follows */
  513.     unsigned char                     prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  514.     unsigned char                     suffixName[1];                /* Variable size, max = 32 */
  515.     char                             data[1];                    /* varaible size data as explained below */
  516. };
  517. typedef struct CMNamedColorType            CMNamedColorType;
  518. /*    
  519.     A variable size array of structs appears as the last block of data
  520.     in the above struct, CMNamedColorType.  The data structure
  521.     is as follows: (example in C)
  522.     
  523.     struct {                                             
  524.         unsigned char    rootName[1];                 * Variable size, max = 32 
  525.         unsigned char    colorCoords[1];                 * Variable size  
  526.     } colorName[1];                                     * Variable size  
  527. */
  528.  
  529. struct CMNamedColor2Type {
  530.     OSType                             typeDescriptor;                /* 'ncl2' */
  531.     unsigned long                     reserved;                    /* fill with 0x00 */
  532.     unsigned long                     vendorFlag;                    /* lower 16 bits reserved for ICC use */
  533.     unsigned long                     count;                        /* count of named colors in array that follows */
  534.     unsigned long                     deviceChannelCount;            /* number of device channels, 0 indicates no device value available */
  535.     unsigned char                     prefixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  536.     unsigned char                     suffixName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  537.     char                             data[1];                    /* varaible size data as definced below */
  538. };
  539. typedef struct CMNamedColor2Type        CMNamedColor2Type;
  540.  
  541. struct CMNamedColor2EntryType {
  542.     unsigned char                     rootName[32];                /* 32 byte field.  7 bit ASCII null terminated */
  543.     unsigned short                     PCSColorCoords[3];            /* Lab or XYZ color */
  544.     unsigned short                     DeviceColorCoords[1];        /* Variable size */
  545. };
  546. typedef struct CMNamedColor2EntryType    CMNamedColor2EntryType;
  547.  
  548. struct CMTextDescriptionType {
  549.     OSType                             typeDescriptor;                /* 'desc' */
  550.     unsigned long                     reserved;                    /* fill with 0x00 */
  551.     unsigned long                     ASCIICount;                    /* the count of "bytes" */
  552.     unsigned char                     ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  553.     unsigned long                     UniCodeCode;
  554.     unsigned long                     UniCodeCount;                /* the count of characters, each character has two bytes */
  555.     unsigned char                     UniCodeName[2];                /* Variable size */
  556.     short                             ScriptCodeCode;
  557.     unsigned char                     ScriptCodeCount;            /* the count of "bytes" */
  558.     unsigned char                     ScriptCodeName[2];            /* Variable size */
  559. };
  560. typedef struct CMTextDescriptionType    CMTextDescriptionType;
  561.  
  562. struct CMTextType {
  563.     OSType                             typeDescriptor;                /* 'text' */
  564.     unsigned long                     reserved;                    /* fill with 0x00 */
  565.     unsigned char                     text[1];                    /* count of text is obtained from tag size element */
  566. };
  567. typedef struct CMTextType                CMTextType;
  568.  
  569. struct CMScreeningType {
  570.     OSType                             typeDescriptor;                /* 'scrn' */
  571.     unsigned long                     reserved;                    /* fill with 0x00 */
  572.     unsigned long                     screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  573.     unsigned long                     channelCount;
  574.     char                             data[1];                    /* varaible size data as explained below */
  575. };
  576. typedef struct CMScreeningType            CMScreeningType;
  577. /*
  578.     A variable size array of structs appears as the last block of data
  579.     in the above struct, CMScreeningType.  The data structure
  580.     is as follows: (example in C)
  581.     
  582.     struct {
  583.         Fixed            frequency;
  584.         Fixed            angle;
  585.         unsigned long    sportFunction;
  586.      }    channelScreening[1];                        * Variable size 
  587. */
  588.  
  589. struct CMSignatureType {
  590.     OSType                             typeDescriptor;                /* 'sig ' */
  591.     unsigned long                     reserved;                    /* fill with 0x00 */
  592.     OSType                             signature;
  593. };
  594. typedef struct CMSignatureType            CMSignatureType;
  595.  
  596. struct CMS15Fixed16ArrayType {
  597.     OSType                             typeDescriptor;                /* 'sf32' */
  598.     unsigned long                     reserved;                    /* fill with 0x00 */
  599.     Fixed                             value[1];                    /* Variable size */
  600. };
  601. typedef struct CMS15Fixed16ArrayType    CMS15Fixed16ArrayType;
  602.  
  603. struct CMU16Fixed16ArrayType {
  604.     OSType                             typeDescriptor;                /* 'uf32' */
  605.     unsigned long                     reserved;                    /* fill with 0x00 */
  606.     unsigned long                     value[1];                    /* Variable size */
  607. };
  608. typedef struct CMU16Fixed16ArrayType    CMU16Fixed16ArrayType;
  609.  
  610. struct CMUInt16ArrayType {
  611.     OSType                             typeDescriptor;                /* 'ui16' */
  612.     unsigned long                     reserved;                    /* fill with 0x00 */
  613.     unsigned short                     value[1];                    /* Variable size */
  614. };
  615. typedef struct CMUInt16ArrayType        CMUInt16ArrayType;
  616.  
  617. struct CMUInt32ArrayType {
  618.     OSType                             typeDescriptor;                /* 'ui32' */
  619.     unsigned long                     reserved;                    /* fill with 0x00 */
  620.     unsigned long                     value[1];                    /* Variable size */
  621. };
  622. typedef struct CMUInt32ArrayType        CMUInt32ArrayType;
  623.  
  624. struct CMUInt64ArrayType {
  625.     OSType                             typeDescriptor;                /* 'ui64' */
  626.     unsigned long                     reserved;                    /* fill with 0x00 */
  627.     unsigned long                     value[1];                    /* Variable size (x2) */
  628. };
  629. typedef struct CMUInt64ArrayType        CMUInt64ArrayType;
  630.  
  631. struct CMUInt8ArrayType {
  632.     OSType                             typeDescriptor;                /* 'ui08' */
  633.     unsigned long                     reserved;                    /* fill with 0x00 */
  634.     unsigned char                     value[1];                    /* Variable size */
  635. };
  636. typedef struct CMUInt8ArrayType            CMUInt8ArrayType;
  637.  
  638. struct CMViewingConditionsType {
  639.     OSType                             typeDescriptor;                /* 'view' */
  640.     unsigned long                     reserved;                    /* fill with 0x00 */
  641.     CMFixedXYZColor                 illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  642.     CMFixedXYZColor                 surround;                    /* absolute XYZs of surround in cd/m^2 */
  643.     unsigned long                     stdIlluminant;                /* see definitions of std illuminants */
  644. };
  645. typedef struct CMViewingConditionsType    CMViewingConditionsType;
  646.  
  647. struct CMXYZType {
  648.     OSType                             typeDescriptor;                /* 'XYZ ' */
  649.     unsigned long                     reserved;                    /* fill with 0x00 */
  650.     CMFixedXYZColor                 XYZ[1];                        /* variable size XYZ tristimulus values */
  651. };
  652. typedef struct CMXYZType                CMXYZType;
  653. /* Profile sequence description type */
  654.  
  655. struct CMProfileSequenceDescType {
  656.     OSType                             typeDescriptor;                /* 'pseq ' */
  657.     unsigned long                     reserved;                    /* fill with 0x00 */
  658.     unsigned long                     count;                        /* Number of descriptions */
  659.     char                             data[1];                    /* varaible size data as explained below */
  660. };
  661. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  662. /*
  663.     A variable size array of structs appears as the last block of data
  664.     in the above struct, CMProfileSequenceDescType.  The data structure
  665.     is as follows: (example in C)
  666.     
  667.     struct {                                             
  668.         OSType            deviceMfg;                     * Device Manufacturer 
  669.         OSType            deviceModel;                 * Decvice Model 
  670.         unsigned long    attributes[2];                 * Device attributes 
  671.         OSType            technology;                     * Technology signature 
  672.         unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  673.         unsigned char    mfgDescASCIIName[2];         * Variable size 
  674.         unsigned long    mfgDescUniCodeCode;             
  675.         unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  676.         unsigned char    mfgDescUniCodeName[2];         * Variable size 
  677.         unsigned long    mfgDescScriptCodeCode;         
  678.         unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  679.         unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  680.         unsigned long    modelDescASCIICount;         * the count of "bytes" 
  681.         unsigned char    modelDescASCIIName[2];         * Variable size 
  682.         unsigned long    modelDescUniCodeCode;         
  683.         unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  684.         unsigned char    modelDescUniCodeName[2];     * Variable size 
  685.         short            modelDescScriptCodeCode;     
  686.         unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  687.         SInt8            filler;                         * For proper alignment across languages 
  688.         unsigned char    modelDescScriptCodeName[2];     * Variable size 
  689.     }    profileDescription[1];                         
  690. */
  691.  
  692. /* Under color removal, black generation type */
  693.  
  694. struct CMUcrBgType {
  695.     OSType                             typeDescriptor;                /* 'bfd  ' */
  696.     unsigned long                     reserved;                    /* fill with 0x00 */
  697.     unsigned long                     ucrCount;                    /* Number of UCR entries */
  698.     unsigned short                     ucrValues[1];                /* variable size */
  699.     unsigned long                     bgCount;                    /* Number of BG entries */
  700.     unsigned short                     bgValues[1];                /* variable size */
  701.     unsigned char                     ucrbgASCII[1];                /* null terminated ASCII string */
  702. };
  703. typedef struct CMUcrBgType                CMUcrBgType;
  704.  
  705. struct CMIntentCRDVMSize {
  706.     long                             renderingIntent;            /* rendering intent */
  707.     unsigned long                     VMSize;                        /* VM size taken up by the CRD */
  708. };
  709. typedef struct CMIntentCRDVMSize        CMIntentCRDVMSize;
  710.  
  711. struct CMPS2CRDVMSizeType {
  712.     OSType                             typeDescriptor;                /* 'psvm' */
  713.     unsigned long                     reserved;                    /* fill with 0x00 */
  714.     unsigned long                     count;                        /* number of intent entries */
  715.     CMIntentCRDVMSize                 intentCRD[1];                /* variable size */
  716. };
  717. typedef struct CMPS2CRDVMSizeType        CMPS2CRDVMSizeType;
  718. /* Video Card Gamma type */
  719.  
  720. enum {
  721.     cmVideoCardGammaTableType    = 0,
  722.     cmVideoCardGammaFormulaType    = 1
  723. };
  724.  
  725.  
  726.  
  727. struct CMVideoCardGammaTable {
  728.     unsigned short                     channels;                    /* # of gamma channels (1 or 3) */
  729.     unsigned short                     entryCount;                    /* 1-based number of entries per channel */
  730.     unsigned short                     entrySize;                    /* size on bytes of each entry */
  731.     char                             data[1];                    /* variable size data follows */
  732. };
  733. typedef struct CMVideoCardGammaTable    CMVideoCardGammaTable;
  734.  
  735. struct CMVideoCardGammaFormula {
  736.     Fixed                             redGamma;                    /* must be > 0.0 */
  737.     Fixed                             redMin;                        /* must be > 0.0 and < 1.0 */
  738.     Fixed                             redMax;                        /* must be > 0.0 and < 1.0 */
  739.     Fixed                             greenGamma;                    /* must be > 0.0 */
  740.     Fixed                             greenMin;                    /* must be > 0.0 and < 1.0 */
  741.     Fixed                             greenMax;                    /* must be > 0.0 and < 1.0 */
  742.     Fixed                             blueGamma;                    /* must be > 0.0 */
  743.     Fixed                             blueMin;                    /* must be > 0.0 and < 1.0 */
  744.     Fixed                             blueMax;                    /* must be > 0.0 and < 1.0 */
  745. };
  746. typedef struct CMVideoCardGammaFormula    CMVideoCardGammaFormula;
  747.  
  748. struct CMVideoCardGamma {
  749.     unsigned long                     tagType;
  750.     union {
  751.         CMVideoCardGammaTable             table;
  752.         CMVideoCardGammaFormula         formula;
  753.     }                                 u;
  754. };
  755. typedef struct CMVideoCardGamma            CMVideoCardGamma;
  756.  
  757. struct CMVideoCardGammaType {
  758.     OSType                             typeDescriptor;                /* 'vcgt' */
  759.     unsigned long                     reserved;                    /* fill with 0x00 */
  760.     CMVideoCardGamma                 gamma;
  761. };
  762. typedef struct CMVideoCardGammaType        CMVideoCardGammaType;
  763.  
  764. struct CMMakeAndModel {
  765.     OSType                             manufacturer;
  766.     unsigned long                     model;
  767.     unsigned long                     serialNumber;
  768.     unsigned long                     manufactureDate;
  769.     unsigned long                     reserved1;                    /* fill with 0x00 */
  770.     unsigned long                     reserved2;                    /* fill with 0x00 */
  771.     unsigned long                     reserved3;                    /* fill with 0x00 */
  772.     unsigned long                     reserved4;                    /* fill with 0x00 */
  773. };
  774. typedef struct CMMakeAndModel            CMMakeAndModel;
  775.  
  776. struct CMMakeAndModelType {
  777.     OSType                             typeDescriptor;                /* 'mmod' */
  778.     unsigned long                     reserved;                    /* fill with 0x00 */
  779.     CMMakeAndModel                     makeAndModel;
  780. };
  781. typedef struct CMMakeAndModelType        CMMakeAndModelType;
  782. /************************************************************************/
  783. /*************** ColorSync 1.0 profile specification ********************/
  784. /************************************************************************/
  785.  
  786. enum {
  787.     cmGrayResponse                = 0,
  788.     cmRedResponse                = 1,
  789.     cmGreenResponse                = 2,
  790.     cmBlueResponse                = 3,
  791.     cmCyanResponse                = 4,
  792.     cmMagentaResponse            = 5,
  793.     cmYellowResponse            = 6,
  794.     cmUcrResponse                = 7,
  795.     cmBgResponse                = 8,
  796.     cmOnePlusLastResponse        = 9
  797. };
  798.  
  799.  
  800. /* Device types */
  801.  
  802. enum {
  803.     cmMonitorDevice                = FOUR_CHAR_CODE('mntr'),
  804.     cmScannerDevice                = FOUR_CHAR_CODE('scnr'),
  805.     cmPrinterDevice                = FOUR_CHAR_CODE('prtr')
  806. };
  807.  
  808.  
  809.  
  810. struct CMIString {
  811.     ScriptCode                         theScript;
  812.     Str63                             theString;
  813. };
  814. typedef struct CMIString                CMIString;
  815. /* Profile options */
  816.  
  817. enum {
  818.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  819.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  820.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  821. };
  822.  
  823. /* Profile flags */
  824.  
  825. enum {
  826.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  827.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  828. };
  829.  
  830.  
  831. typedef long                             CMMatchOption;
  832. typedef long                             CMMatchFlag;
  833.  
  834. struct CMHeader {
  835.     unsigned long                     size;
  836.     OSType                             CMMType;
  837.     unsigned long                     applProfileVersion;
  838.     OSType                             dataType;
  839.     OSType                             deviceType;
  840.     OSType                             deviceManufacturer;
  841.     unsigned long                     deviceModel;
  842.     unsigned long                     deviceAttributes[2];
  843.     unsigned long                     profileNameOffset;
  844.     unsigned long                     customDataOffset;
  845.     CMMatchFlag                     flags;
  846.     CMMatchOption                     options;
  847.     CMXYZColor                         white;
  848.     CMXYZColor                         black;
  849. };
  850. typedef struct CMHeader                    CMHeader;
  851.  
  852. struct CMProfileChromaticities {
  853.     CMXYZColor                         red;
  854.     CMXYZColor                         green;
  855.     CMXYZColor                         blue;
  856.     CMXYZColor                         cyan;
  857.     CMXYZColor                         magenta;
  858.     CMXYZColor                         yellow;
  859. };
  860. typedef struct CMProfileChromaticities    CMProfileChromaticities;
  861.  
  862. struct CMProfileResponse {
  863.     unsigned short                     counts[9];
  864.     unsigned short                     data[1];                    /* Variable size */
  865. };
  866. typedef struct CMProfileResponse        CMProfileResponse;
  867.  
  868. struct CMProfile {
  869.     CMHeader                         header;
  870.     CMProfileChromaticities         profile;
  871.     CMProfileResponse                 response;
  872.     CMIString                         profileName;
  873.     char                             customData[1];                /* Variable size */
  874. };
  875. typedef struct CMProfile                CMProfile;
  876. typedef CMProfile *                        CMProfilePtr;
  877. typedef CMProfilePtr *                    CMProfileHandle;
  878. #if OLDROUTINENAMES
  879.  
  880. enum {
  881.     kCMApplProfileVersion        = cmCS1ProfileVersion
  882. };
  883.  
  884.  
  885. enum {
  886.     grayResponse                = cmGrayResponse,
  887.     redResponse                    = cmRedResponse,
  888.     greenResponse                = cmGreenResponse,
  889.     blueResponse                = cmBlueResponse,
  890.     cyanResponse                = cmCyanResponse,
  891.     magentaResponse                = cmMagentaResponse,
  892.     yellowResponse                = cmYellowResponse,
  893.     ucrResponse                    = cmUcrResponse,
  894.     bgResponse                    = cmBgResponse,
  895.     onePlusLastResponse            = cmOnePlusLastResponse
  896. };
  897.  
  898.  
  899. enum {
  900.     rgbData                        = cmRGBData,
  901.     cmykData                    = cmCMYKData,
  902.     grayData                    = cmGrayData,
  903.     xyzData                        = cmXYZData
  904. };
  905.  
  906.  
  907. enum {
  908.     XYZData                        = cmXYZData
  909. };
  910.  
  911.  
  912. enum {
  913.     monitorDevice                = cmMonitorDevice,
  914.     scannerDevice                = cmScannerDevice,
  915.     printerDevice                = cmPrinterDevice
  916. };
  917.  
  918.  
  919. enum {
  920.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  921.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  922. };
  923.  
  924.  
  925. enum {
  926.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  927.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  928.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  929. };
  930.  
  931.  
  932. typedef unsigned short                     XYZComponent;
  933. typedef CMXYZColor                         XYZColor;
  934. typedef unsigned short                     CMResponseData;
  935. typedef CMIString                         IString;
  936. typedef long                             CMResponseColor;
  937. typedef CMResponseColor                 responseColor;
  938. #endif  /* OLDROUTINENAMES */
  939.  
  940.  
  941.  
  942. #if PRAGMA_STRUCT_ALIGN
  943.     #pragma options align=reset
  944. #elif PRAGMA_STRUCT_PACKPUSH
  945.     #pragma pack(pop)
  946. #elif PRAGMA_STRUCT_PACK
  947.     #pragma pack()
  948. #endif
  949.  
  950. #ifdef PRAGMA_IMPORT_OFF
  951. #pragma import off
  952. #elif PRAGMA_IMPORT
  953. #pragma import reset
  954. #endif
  955.  
  956. #ifdef __cplusplus
  957. }
  958. #endif
  959.  
  960. #endif /* __CMICCPROFILE__ */
  961.  
  962.